<?php
namespace App\Repositories;

use App\Models\News;
use App\Exceptions\InvalidException;
class NewsRepo extends BaseRepo
{
    public function __construct(){
        parent::$model = new News();
    }

    public function getNewsList($pageSize=10)
    {
        return News::where('status',1)->paginate($pageSize);
    }
     public function getNewsInfo(int $id)
    {
        return News::where('status',1)->where('id',$id)->first();
    }
    public function getHomeNews()
    {
        return News::where('status',1)->limit(4)->get();
    }
}